package com.hubei.car.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.time.LocalDateTime;

/**
 * 产品
 * @author huanghaisheng
 * @create 2019-11-26
 */
@ApiModel(value="产品")
@Data
@TableName(value = "ms_product")
@Accessors(chain = true)
public class MsProduct {

    @TableId(value = "id",type = IdType.AUTO)
    @ApiModelProperty(value="产品主键id,修改时必填，增加时不填")
    private Long id;

    @TableField(value = "ptid")
    @ApiModelProperty(value="产品目录id")
    private Long ptid;

    @TableField(exist = false)
    @ApiModelProperty(value="产品目录对象")
    private MsProductType msProductType;

    @TableField(value = "name")
    @ApiModelProperty(value="产品名称", required = true)
    private String name;

    @TableField(value = "sale_date")
    @ApiModelProperty(value="上架日期")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime saleDate;

    @TableField(value = "price")
    @ApiModelProperty(value="产品价格")
    private BigDecimal price;

    @TableField(value = "contents")
    @ApiModelProperty(value="产品详情")
    private String contents;

    @TableField(value = "createdate")
    @ApiModelProperty(value="创建日期", hidden = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp createdate;

    @TableField(value = "price_start_date")
    @ApiModelProperty(value="价格开始日期", hidden = true)
    @JsonFormat(pattern = "MM-dd", timezone = "GMT+8")
    private LocalDateTime priceStartDate;

    @TableField(value = "price_end_date")
    @ApiModelProperty(value="价格结束日期", hidden = true)
    @JsonFormat(pattern = "MM-dd", timezone = "GMT+8")
    private LocalDateTime priceEndDate;

    @TableField(value = "createid")
    @ApiModelProperty(value="创建人id", hidden = true)
    private Long createid;

    @TableField(value = "createname")
    @ApiModelProperty(value="创建人名称", hidden = true)
    private String createname;

    @TableField(value = "defaultimages")
    @ApiModelProperty(value="默认图，多图逗号分割")
    private String defaultimages;

    @TableField(value = "istop")
    @ApiModelProperty(value="是否置顶")
    private Boolean istop;

    @TableField(value = "isrecommend")
    @ApiModelProperty(value="是否推荐")
    private Boolean isrecommend;

    @TableField(value = "isstop")
    @ApiModelProperty(value="是否禁用")
    private Boolean isstop;

    @TableField(value = "sort")
    @ApiModelProperty(value="排序")
    private Integer sort;

    @TableField(value = "image_index")
    @ApiModelProperty(value="图片排列序号")
    private Integer imageIndex;

}
